import request from '@/utils/request'

export function getBackAccountList(params) {
  return request({
    url: 'user/getPlatformUserList',
    method: 'get',
    params: params
  })
}

export function getScenicAccountList(params) {
  return request({
    url: 'user/getScenicUserList',
    method: 'get',
    params: params
  })
}

export function getDistributorAccountList(params) {
  return request({
    url: 'user/getDistributorUserList',
    method: 'get',
    params: params
  })
}

export function getBackAccountInfo(params) {
  return request({
    url: 'user/queryUserByUserId',
    method: 'get',
    params: params
  })
}

export function getRolesList(params) {
  return request({
    url: 'user/getResourceList',
    method: 'get',
    params: params
  })
}

export function addPlatformUser(params) {
  return request({
    url: 'user/addPlatformUser',
    method: 'post',
    data: params
  })
}

export function addScenicUser(params) {
  return request({
    url: 'user/addScenicUser',
    method: 'post',
    data: params
  })
}

export function addDistributorUser(params) {
  return request({
    url: 'user/addDistributorUser',
    method: 'post',
    data: params
  })
}

export function getPlatformModifyData(id) {
  return request({
    url: 'user/queryUserByUserId/' + id,
    method: 'get'
  })
}

export function submitPlatformModifyData(id, data) {
  return request({
    url: 'user/updateUserByUserId/' + id,
    method: 'put',
    data
  })
}

export function updatePlatformUserState(id, data) {
  return request({
    url: 'user/updateUserState/' + id,
    method: 'put',
    data
  })
}

export function checkUserName(data, id) {
  return request({
    url: 'user/checkUserName/' + data,
    method: 'get',
    params: id
  })
}

export function checkDistributorName(data, id) {
  return request({
    url: 'user/checkDistributorName/' + data,
    method: 'get',
    params: id
  })
}

export function queryScenicOrgList() {
  return request({
    url: 'user/queryScenicOrgList',
    method: 'get'
  })
}

export function updateDistributorInfo(id, data) {
  return request({
    url: 'user/updateUserByUserId/' + id,
    method: 'put',
    data
  })
}

export function rechargeQueryInfo(id) {
  return request({
    url: 'distributor/queryDistributorById/' + id,
    method: 'get'
  })
}

export function distributorRecharge(id, data) {
  return request({
    url: 'distributor/recharge/' + id,
    method: 'put',
    data
  })
}
